﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="http://netdna.bootstrapcdn.com/bootstrap/2.3.2/css/bootstrap.min.css" rel="stylesheet">
<title>lecture2a</title>
<style>
    textarea[name=memo] { width: 500px; height: 200px; }
    label { margin-top: 20px; }
    input[type=radio]:nth-child(2) { margin-left: 20px; }
</style>
</head>
<div class="container">

<h1>User Data 입력</h1>

<form method="post">
    <label>현재시각</label>
    <span class="uneditable-input">${ currentTime }</span>

    <label>이름</label>
    <input type="text" name="name" placeholder="이름을 입력하세요" value="${ userData.name }" />

    <label>나이</label>
    <input type="text" name="age" placeholder="나이를 입력하세요" value="${ userData.age }" />

    <label>무지개</label>
    <select name="color">
        <option ${ userData.color == '빨강' ? 'selected' : '' }>빨강</option>
        <option ${ userData.color == '주황' ? 'selected' : '' }>주황</option>
        <option ${ userData.color == '노랑' ? 'selected' : '' }>노랑</option>
        <option ${ userData.color == '초록' ? 'selected' : '' }>초록</option>
        <option ${ userData.color == '파랑' ? 'selected' : '' }>파랑</option>
        <option ${ userData.color == '남색' ? 'selected' : '' }>남색</option>
        <option ${ userData.color == '보라' ? 'selected' : '' }>보라</option>
    </select>

    <label>성별</label>
    <p>
        <input type="radio" name="sex" value="남자" ${ userData.sex == '남자' ? 'checked' : '' }>남자
        <input type="radio" name="sex" value="여자" ${ userData.sex == '여자' ? 'checked' : '' }>여자
    </p>

    <label>메모</label>
    <textarea name="memo">${ userData.memo }</textarea>

    <div>
        <input type="submit" class="btn btn-primary" value="저장" />
    </div>
</form>

<div class="alert alert-error">
    ${ errorMessage }
</div>

</div>

</body>
</html>
